The present invention is generally directed to the self-healing of layer metadata within a layering system. A layering system is a tool that enables an operating system, user applications, and user data to be layered on the user's computing device. When using a layering system, layered applications and data are executed natively on the user's computing device without the use of a virtual machine or other sandboxed execution environment. This native execution will therefore cause the layered applications to appear, both to the user and to other applications, as if they were being executed in a “normal” manner. This is in contrast to many types of virtualization techniques such as terminal services and application virtualization where it is typically clear that the applications are executed in a separate environment.
U.S. patent application Ser. Nos. 14/719,248 and 14/719,256 are both directed to a layering system and provide a background for the present invention. The content of these applications is therefore incorporated by reference. It is noted that both of these applications are commonly owned and would not constitute prior art to the present invention. Therefore, this background should not be construed as admitting prior art, but should be construed as describing various features on which the present invention is based and that may even form part of the present invention.
As is described in the '248 and '256 applications, a layer is a collection of data or resources which enables the collection to be isolated or set apart from the data or resources in another layer. To summarize this layering, FIG. 1 provides simplified examples of a user data layer 101 and an application layer 102. Each layer can be stored in a manner that allows the layer to be separately mounted for access. For example, each layer may comprise a separate partition of a disk (including of a virtual disk). The ability to separately mount a layer allows the layering system to selectively provide access to particular layers. It will be assumed that the layering system determines that user data layer 101 and application layer 102 should be mounted in response to the user logging in to a computing device on which the layering system executes or which the layering system otherwise controls.
As shown in FIG. 1 and for simplicity, application layer 102 includes a single application, WINWORD.EXE, which is the executable for Microsoft Word. Word also requires a number of registry settings to execute properly, and therefore, application layer 102 also includes such registry settings. It is noted that these registry settings, which would normally be stored within the registry of the operating system, could be stored within application layer 102 in a registry hive. Of course, a typical installation of Word would require a number of other files and/or settings which are not depicted. Application layer 102 also includes layer metadata which describes the content of application layer 102 (e.g., which describes that the layer includes WINWORD.EXE and whatever structure is used to store the Word registry settings). This layer metadata is critical because it allows the layering system to quickly determine what exists on the layer.
User data layer 101 is structured in a similar way. However, as a user data layer, it stores the user's files which in this case constitute two Word documents: Report.docx and Summary.docx. As with application layer 102, user data layer 101 may also store a number of other files including configuration files that may be particular to this user (e.g., a template file for Word). User data layer 101 also includes layer metadata which defines the content of the layer. Again, this layer metadata is critical because it allows the layering system to quickly determine what exists on the layer.
As mentioned above, a layer can be a separately mountable portion of a storage device (whether physical or virtual) such as a partition. Accordingly, when the user logs on to a computing device, the layering system can mount layers 101 and 102 so that the user will have access to MS Word and his documents which are included in these layers. However, if a different user were to log in to the same computing device, the layering system could instead mount an application layer and user data layer pertaining to the different user so that the different user can only access the applications and user data defined in those layers.
The process by which the user accesses the data and resources included on each layer is provided in the '248 and '256 applications and will not be described in detail in this specification. By way of an overview, the layering system includes a file system filter driver and a registry filter driver which can function to intercept and redirect file system and registry operations as appropriate. In particular, these filters can be registered with the OS so that they will receive all file system and registry operations respectively. If a file system or registry operation pertains to content of a layer rather than to content of the file system or registry directly provided by the OS, the filters can redirect the operation to the corresponding layer. The '248 and '256 applications provide a number of examples of this type of redirection.
The result of this redirection is that, from the user perspective, the files of the layers do not appear to be stored in a different manner than any other file would typically be stored by the OS. For example, if the user data layer 101 were assigned a partition of E:, the layering system could cause the files to appear as if they were stored in the typical C: partition. In other words, the fact that multiple partitions may be loaded is abstracted (and even hidden) from the user perspective. It is again reiterated that the use of layer metadata to define what is stored on each layer allows this process to be carried out efficiently as is described in the '248 and '256 applications.
For performance reasons, layer metadata and updates to it are cached in memory and periodically flushed to disk. However, in some cases, it may not be possible to flush the in memory version of the layer metadata which would cause the persisted layer metadata to become inconsistent. For example, if a user initiated a shutdown while the layers are mounted, the operating system's shutdown mechanism may not wait long enough for the layering system to flush the cached layer metadata. Similarly, in the event of a system crash or a cache handling issue caused by the OS, the cached layer metadata may not be flushed. When such events occur to prevent the flushing of the layer metadata, the next time the layer is mounted, the layer metadata would provide an inaccurate representation of the contents of the layer. Therefore, even though files of the layer would be present on the underlying storage device, they would not be visible to the end user.